<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->group([
    'namespace' => 'App\Http\Controllers'
], function ($app) {
    //页面路由
    $app->get('', 'DefaultController@index');
    $app->get('/index', 'DefaultController@index');
    $app->get('/index.html', 'DefaultController@index');
    $app->get('/login.html', 'DefaultController@login');
    $app->get('/logout.html', 'DefaultController@logout');

    $app->get('/user/index.html', 'UserController@index');
    $app->get('/user/contest.html', 'UserController@contest');
    $app->get('/user/contest-detail-{id}.html', 'UserController@contestDetail');
    $app->get('/user/file.html', 'UserController@file');
    $app->get('/user/increase.html', 'UserController@increase');
    $app->get('/user/increase-create.html', 'UserController@increaseCrease');
    $app->get('/user/increase-edit-{id}.html', 'UserController@increaseEdit');
    $app->get('/user/star.html', 'UserController@star');

    $app->get('/department/index.html', 'DepartmentController@index');
    $app->get('/department/contest.html', 'DepartmentController@contest');
    $app->get('/department/contest-detail-{id}.html', 'DepartmentController@contestDetail');
    $app->get('/department/file.html', 'DepartmentController@file');
    $app->get('/department/increase.html', 'DepartmentController@increase');
    $app->get('/department/increase-create.html', 'DepartmentController@increaseCreate');
    $app->get('/department/increase-edit-{id}.html', 'DepartmentController@increaseEdit');
    $app->get('/department/star.html', 'DepartmentController@star');
    $app->get('/department/user.html', 'DepartmentController@user');
    $app->get('/department/user/detail-{id}.html', 'DepartmentController@userDetail');
    $app->get('/department/user/file-detail-{id}.html', 'DepartmentController@userFileDetail');
    $app->get('/department/user/increase-detail-{id}.html', 'DepartmentController@userIncreaseDetail');
    $app->get('/department/grade-increase-{id}-user-{uid}.html', 'DepartmentController@gradeUserIncrease');



    $app->get('/manager/user.html', 'ManagerController@user');
    $app->get('/manager/user/detail-{id}.html', 'ManagerController@userDetail');
    $app->get('/manager/department/detail-{id}.html', 'ManagerController@departmentDetail');
    $app->get('/manager/department.html', 'ManagerController@department');
    $app->get('/manager/rule.html', 'ManagerController@rule');
    $app->get('/manager/rule-create.html', 'ManagerController@ruleCreate');
    $app->get('/manager/rule-edit-{id}.html', 'ManagerController@ruleEdit');
    $app->get('/manager/contest.html', 'ManagerController@contest');
    $app->get('/manager/contest-create.html', 'ManagerController@contestCreate');
    $app->get('/manager/contest-edit-{id}.html', 'ManagerController@contestEdit');
    $app->get('/manager/file.html', 'ManagerController@file');
    $app->get('/manager/file-create.html', 'ManagerController@fileCreate');
    $app->get('/manager/file-edit-{id}.html', 'ManagerController@fileEdit');
    $app->get('/manager/user/file-detail-{id}.html', 'ManagerController@userFileDetail');
    $app->get('/manager/department/file-detail-{id}.html', 'ManagerController@departmentFileDetail');
    $app->get('/manager/increase.html', 'ManagerController@increase');
    $app->get('/manager/user/increase-detail-{id}.html', 'ManagerController@userIncreaseDetail');
    $app->get('/manager/department/increase-detail-{id}.html', 'ManagerController@departmentIncreaseDetail');
    $app->get('/manager/grade-increase-{id}-department-{departmentId}.html', 'ManagerController@gradeDepartmentIncrease');
    $app->get('/manager/grow.html', 'ManagerController@grow');
    $app->get('/manager/grow-create.html', 'ManagerController@growCreate');
    $app->get('/manager/grow-edit-{id}.html', 'ManagerController@growEdit');
    $app->get('/data.html', 'ManagerController@data');

    $app->get('/v1/check.json', 'Controller@check');
    $app->post('/v1/login', 'Controller@login');
    $app->post('/upload', 'UploadController@index');
    $app->post('/upfile', 'UploadController@file');
});

$app->group([
    'namespace' => 'App\Http\Controllers\V1'
], function ($app) {
    //接口路由
    $app->get('/v1/user/level.json', 'UserController@level');
    $app->get('/v1/user/department.json', 'UserController@department');
    $app->get('/v1/user/file.json', 'UserController@file');
    $app->get('/v1/user/advice.json', 'UserController@advice');
    $app->get('/v1/user/contest/list.json', 'UserController@contest');
    $app->get('/v1/user/contest/detail.json', 'UserController@contestDetail');
    $app->get('/v1/user/score/file.json', 'UserController@scoreFile');
    $app->get('/v1/user/score/file/detail.json', 'UserController@scoreFileDetail');
    $app->get('/v1/user/increase/score/list.json', 'UserController@increaseScore');
    $app->get('/v1/user/increase/score/detail.json', 'UserController@increaseScoreDetail');
    $app->get('/v1/user/star.json', 'UserController@star');
    $app-> post('/v1/user/update', 'UserController@update');
    $app-> post('/v1/user/save/score/file/score', 'UserController@saveScoreFileScore');
    $app-> post('/v1/user/save/increase/score', 'UserController@saveIncreaseScore');
    $app-> post('/v1/user/delete/increase/score', 'UserController@deleteIncreaseScore');
    $app-> post('/v1/user/save/level', 'UserController@saveLevel');

    $app->get('/v1/department/user/level.json', 'DepartmentController@userLevel');
    $app->get('/v1/department/advice.json', 'DepartmentController@advice');
    $app->get('/v1/department/contest/list.json', 'DepartmentController@contest');
    $app->get('/v1/department/contest/detail.json', 'DepartmentController@contestDetail');
    $app->get('/v1/department/file.json', 'DepartmentController@file');
    $app->get('/v1/department/simple/users.json', 'DepartmentController@simpleUsers');
    $app->get('/v1/department/score/file.json', 'DepartmentController@scoreFile');
    $app->get('/v1/department/score/file/detail.json', 'DepartmentController@scoreFileDetail');
    $app->get('/v1/department/users.json', 'DepartmentController@users');
    $app->get('/v1/department/increase/score/list.json', 'DepartmentController@increaseScore');
    $app->get('/v1/department/increase/score/detail.json', 'DepartmentController@increaseScoreDetail');
    $app->get('/v1/department/user/increase/score.json', 'DepartmentController@userIncreaseScore');
    $app->get('/v1/department/star.json', 'DepartmentController@star');
    $app->get('/v1/department/user/detail.json', 'DepartmentController@userDetail');
    $app->get('/v1/department/advice/to/user.json', 'DepartmentController@adviceToUser');
    $app->get('/v1/department/user/score/file.json', 'DepartmentController@userScoreFiles');
    $app->get('/v1/department/user/score/file/detail.json', 'DepartmentController@userScoreFileDetail');
    $app->post('/v1/department/save/file', 'DepartmentController@saveFile');
    $app->post('/v1/department/save/increase/score', 'DepartmentController@saveIncreaseScore');
    $app->post('/v1/department/delete/increase/score', 'DepartmentController@deleteIncreaseScore');
    $app->post('/v1/department/save/contest', 'DepartmentController@saveContest');
    $app->post('/v1/department/delete/contest', 'DepartmentController@deleteContest');
    $app->post('/v1/department/delete/user', 'DepartmentController@deleteUser');
    $app->post('/v1/department/save/score/file/score', 'DepartmentController@saveScoreFileScore');
    $app->post('/v1/department/save/user/score/file/score', 'DepartmentController@saveUserScoreFileScore');
    $app->post('/v1/department/save/advice/to/user', 'DepartmentController@saveAdvice');
    $app->post('/v1/department/save/user/increase', 'DepartmentController@saveUserIncrease');
    $app-> post('/v1/department/save/user/level', 'DepartmentController@saveUserLevel');

    $app->get('/v1/manager/user/level.json', 'ManagerController@userLevel');
    $app->get('/v1/manager/check/user/name.json', 'ManagerController@checkUsername');
    $app->get('/v1/manager/users.json', 'ManagerController@users');
    $app->get('/v1/manager/user/detail.json', 'ManagerController@userDetail');
    $app->get('/v1/manager/departments.json', 'ManagerController@departments');
    $app->get('/v1/manager/department/detail.json', 'ManagerController@departmentDetail');
    $app->get('/v1/manager/increase/score/list.json', 'ManagerController@increaseScore');
    $app->get('/v1/manager/user/increase/score.json', 'ManagerController@userIncreaseScore');
    $app->get('/v1/manager/department/increase/score.json', 'ManagerController@departmentIncreaseScore');
    $app->get('/v1/manager/increase/score/detail.json', 'ManagerController@increaseScoreDetail');
    $app->get('/v1/manager/contest/list.json', 'ManagerController@contest');
    $app->get('/v1/manager/contest/detail.json', 'ManagerController@contestDetail');
    $app->get('/v1/manager/department/file.json', 'ManagerController@departmentFile');
    $app->get('/v1/manager/rules.json', 'ManagerController@rules');
    $app->get('/v1/manager/rule/detail.json', 'ManagerController@ruleDetail');
    $app->get('/v1/manager/simple/departments.json', 'ManagerController@simpleDepartments');
    $app->get('/v1/manager/grow/rules.json', 'ManagerController@growRules');
    $app->get('/v1/manager/grow/rule/detail.json', 'ManagerController@growRuleDetail');
    $app->get('/v1/manager/advice/to/user.json', 'ManagerController@adviceToUser');
    $app->get('/v1/manager/advice/to/department.json', 'ManagerController@adviceToDepartment');
    $app->get('/v1/manager/department/score/file.json', 'ManagerController@departmentScoreFiles');
    $app->get('/v1/manager/department/score/file/detail.json', 'ManagerController@departmentScoreFileDetail');
    $app->get('/v1/manager/department/users.json', 'ManagerController@departmentUsers');
    $app->get('/v1/manager/score/file/list.json', 'ManagerController@scoreFiles');
    $app->get('/v1/manager/user/score/file.json', 'ManagerController@userScoreFiles');
    $app->get('/v1/manager/user/score/file/detail.json', 'ManagerController@userScoreFileDetail');
    $app->get('/v1/manager/score/file/detail.json', 'ManagerController@scoreFileDetail');

    $app->get('/v1/manager/data/users.json', 'ManagerController@dataUsers');
    $app->post('/v1/manager/save/manager', 'ManagerController@saveManager');
    $app->post('/v1/manager/delete/manager', 'ManagerController@deleteManager');
    $app->post('/v1/manager/save/contest', 'ManagerController@saveContest');
    $app->post('/v1/manager/delete/contest', 'ManagerController@deleteContest');
    $app->post('/v1/manager/delete/file', 'ManagerController@deleteFile');
    $app->post('/v1/manager/save/grow/rule', 'ManagerController@saveGrowRule');
    $app->post('/v1/manager/save/score/file', 'ManagerController@saveScoreFile');
    $app->post('/v1/manager/delete/score/file', 'ManagerController@deleteScoreFile');
    $app->post('/v1/manager/delete/grow/rule', 'ManagerController@deleteGrowRule');
    $app->post('/v1/manager/delete/user', 'ManagerController@deleteUser');
    $app->post('/v1/manager/delete/department', 'ManagerController@deleteDepartment');
    $app->post('/v1/manager/save/user/score/file/score', 'ManagerController@saveUserScoreFileScore');
    $app->post('/v1/manager/save/department/score/file/score', 'ManagerController@saveDepartmentScoreFileScore');
    $app->post('/v1/manager/save/advice/to/user', 'ManagerController@saveAdviceToUser');
    $app->post('/v1/manager/save/advice/to/department', 'ManagerController@saveAdviceToDepartment');
    $app->post('/v1/manager/save/department/increase', 'ManagerController@saveDepartmentIncrease');
    $app->post('/v1/manager/delete/increase/score', 'ManagerController@deleteIncreaseScore');
    $app-> post('/v1/manager/save/user/level', 'ManagerController@saveUserLevel');
});
